{include="header"}

<form name="f_347" action="{$fsc->url()}" method="post" class="form">
   <div class="container-fluid">
      <div class="row">
         <div class="col-lg-3 col-md-3 col-sm-3">
            <div class="form-group">
               Clientes que han comprado más de...
               <div class="input-group">
                  <input class="form-control text-right" type="text" name="cantidad" value="{$fsc->cantidad}" autocomplete="off"/>
                  <span class="input-group-addon">{$fsc->simbolo_divisa()}</span>
               </div>
            </div>
         </div>
         <div class="col-lg-2 col-md-2 col-sm-2">
            <div class="form-group">
               en el año:
               <select class="form-control" name="ejercicio" onchange="document.f_347.submit()">
               {loop="$fsc->ejercicio->all()"}
                  {if condition="$fsc->sejercicio==$value->year()"}
                  <option value="{$value->year()}" selected="selected">{$value->year()}</option>
                  {else}
                  <option value="{$value->year()}">{$value->year()}</option>
                  {/if}
               {/loop}
               </select>
            </div>
         </div>
      </div>
   </div>
</form>

<div class="table-responsive">
   <table class="table table-hover">
      <thead>
         <tr>
            <th class="text-left">Cliente</th>
            <th class="text-right">1º trimestre</th>
            <th class="text-right">2º trimestre</th>
            <th class="text-right">3º trimestre</th>
            <th class="text-right">4º trimestre</th>
            <th class="text-right">Total</th>
         </tr>
      </thead>
      {loop="$fsc->datos_cli['filas']"}
      <tr>
         <td><a href="{$value['cliente']->url()}">{$value['cliente']->nombre}</a></td>
         <td class="text-right">{$fsc->show_precio($value['t1'])}</td>
         <td class="text-right">{$fsc->show_precio($value['t2'])}</td>
         <td class="text-right">{$fsc->show_precio($value['t3'])}</td>
         <td class="text-right">{$fsc->show_precio($value['t4'])}</td>
         <td class="text-right">{$fsc->show_precio($value['total'])}</td>
      </tr>
      {/loop}
      <tr>
         <td></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_cli['totales'][0])}</b></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_cli['totales'][1])}</b></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_cli['totales'][2])}</b></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_cli['totales'][3])}</b></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_cli['totales'][4])}</b></td>
      </tr>
   </table>
</div>

<div class="container-fluid">
   <div class="row">
      <div class="col-lg-12 col-md-12 col-sm-12">
         <h4>
            Proveedores que nos han vendido más de <mark>{$fsc->show_precio($fsc->cantidad)}</mark>
            en el año <mark>{$fsc->sejercicio}</mark>
         </h4>
      </div>
   </div>
</div>

<div class="table-responsive">
   <table class="table table-hover">
      <thead>
         <tr>
            <th class="text-left">Proveedor</th>
            <th class="text-right">1º trimestre</th>
            <th class="text-right">2º trimestre</th>
            <th class="text-right">3º trimestre</th>
            <th class="text-right">4º trimestre</th>
            <th class="text-right">Total</th>
         </tr>
      </thead>
      {loop="$fsc->datos_pro['filas']"}
      <tr>
         <td><a href="{$value['proveedor']->url()}">{$value['proveedor']->nombre}</a></td>
         <td class="text-right">{$fsc->show_precio($value['t1'])}</td>
         <td class="text-right">{$fsc->show_precio($value['t2'])}</td>
         <td class="text-right">{$fsc->show_precio($value['t3'])}</td>
         <td class="text-right">{$fsc->show_precio($value['t4'])}</td>
         <td class="text-right">{$fsc->show_precio($value['total'])}</td>
      </tr>
      {/loop}
      <tr>
         <td></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_pro['totales'][0])}</b></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_pro['totales'][1])}</b></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_pro['totales'][2])}</b></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_pro['totales'][3])}</b></td>
         <td class="text-right"><b>{$fsc->show_precio($fsc->datos_pro['totales'][4])}</b></td>
      </tr>
   </table>
</div>

{include="footer"}
